<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>排班管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出用户数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/phy/tSchedue/export");
						$("#searchForm").submit();
						$("#searchForm").attr("action","${ctx}/phy/tSchedue/");
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/phy/tSchedue/">排班列表</a></li>
<%--		<shiro:hasPermission name="phy:tSchedue:edit"><li><a href="${ctx}/phy/tSchedue/form">排班添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="tSchedue" action="${ctx}/phy/tSchedue/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>医生名称：</label>
				<form:input path="doctorName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>所属机构：</label>
				<form:input path="tenantName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>年份：</label>
				<form:select path="scheduleYear" class="input-small">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('schedule_year')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>年份：</label>
				<form:select path="scheduleMonth" class="input-mini">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('schedule_month')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns"><input id="btnExport" class="btn btn-primary" type="button" value="导出"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed" style="width: 3000px">
		<thead>
			<tr>
				<shiro:hasPermission name="phy:sys:id"><th style="padding-bottom: 10px">id</th></shiro:hasPermission>
				<th style="padding-bottom: 10px">所属机构</th>
				<th style="padding-bottom: 10px">所属诊室</th>
				<th style="padding-bottom: 10px">医生名称</th>
				<th style="padding-bottom: 10px">年份</th>
				<c:forEach items="${days}" var="item" varStatus="status">
					<th>${tSchedue.scheduleMonth}月${status.index + 1}日<br/>(${fns:getDictLabel(item, 'schedule_week', '')})</th>
				</c:forEach>
				<th style="padding-bottom: 10px">更新时间</th>
				<th style="padding-bottom: 10px">备注</th>
				<shiro:hasPermission name="phy:tSchedue:edit"><th style="padding-bottom: 10px">操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tSchedue">
			<tr>
				<shiro:hasPermission name="phy:sys:id">
					<td>
							${tSchedue.id}
					</td>
				</shiro:hasPermission>
				<td>${tSchedue.tenant.tenantName}</td>
				<td>${tSchedue.office.officeName}</td>
				<c:if test="${empty tSchedue.doctor.remarks}">
					<td>${tSchedue.doctor.doctorName}</td>
				</c:if>
				<c:if test="${not empty tSchedue.doctor.remarks}">
					<td>${tSchedue.doctor.doctorName}(${tSchedue.doctor.remarks})</td>
				</c:if>

				<td>${tSchedue.scheduleYear}</td>
				<td>
					${fns:getDictLabel(tSchedue.first, 'schedue_template', '')}
					<br/>
						<c:if test="${tSchedue.first == 1}">
							号源:(${tSchedue.amFirst})
						</c:if>
						<c:if test="${tSchedue.first == 2}">
							号源:(${tSchedue.pmFirst})
						</c:if>
						<c:if test="${tSchedue.first == 3}">
							号源:(${tSchedue.amFirst + tSchedue.pmFirst})
						</c:if>
						<c:if test="${tSchedue.first == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.second, 'schedue_template', '')}
					<br/>
						<c:if test="${tSchedue.second == 1}">
							号源:(${tSchedue.amSecond})
						</c:if>
						<c:if test="${tSchedue.second == 2}">
							号源:(${tSchedue.pmSecond})
						</c:if>
						<c:if test="${tSchedue.second == 3}">
							号源:(${tSchedue.amSecond + tSchedue.pmSecond})
						</c:if>
						<c:if test="${tSchedue.second == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.third, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.third == 1}">
							号源:(${tSchedue.amThird})
						</c:if>
						<c:if test="${tSchedue.third == 2}">
							号源:(${tSchedue.pmThird})
						</c:if>
						<c:if test="${tSchedue.third == 3}">
							号源:(${tSchedue.amThird + tSchedue.pmThird})
						</c:if>
						<c:if test="${tSchedue.third == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.fourth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.fourth == 1}">
							号源:(${tSchedue.amFourth})
						</c:if>
						<c:if test="${tSchedue.fourth == 2}">
							号源:(${tSchedue.pmFourth})
						</c:if>
						<c:if test="${tSchedue.fourth == 3}">
							号源:(${tSchedue.amFourth + tSchedue.pmFourth})
						</c:if>
						<c:if test="${tSchedue.fourth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.fifth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.fifth == 1}">
							号源:(${tSchedue.amFifth})
						</c:if>
						<c:if test="${tSchedue.fifth == 2}">
							号源:(${tSchedue.pmFifth})
						</c:if>
						<c:if test="${tSchedue.fifth == 3}">
							号源:(${tSchedue.amFifth + tSchedue.pmFifth})
						</c:if>
						<c:if test="${tSchedue.fifth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.sixth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.sixth == 1}">
							号源:(${tSchedue.amSixth})
						</c:if>
						<c:if test="${tSchedue.sixth == 2}">
							号源:(${tSchedue.pmSixth})
						</c:if>
						<c:if test="${tSchedue.sixth == 3}">
							号源:(${tSchedue.amSixth + tSchedue.pmSixth})
						</c:if>
						<c:if test="${tSchedue.sixth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.seventh, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.seventh == 1}">
							号源:(${tSchedue.amSeventh})
						</c:if>
						<c:if test="${tSchedue.seventh == 2}">
							号源:(${tSchedue.pmSeventh})
						</c:if>
						<c:if test="${tSchedue.seventh == 3}">
							号源:(${tSchedue.amSeventh + tSchedue.pmSeventh})
						</c:if>
						<c:if test="${tSchedue.seventh == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.eighth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.eighth == 1}">
							号源:(${tSchedue.amEighth})
						</c:if>
						<c:if test="${tSchedue.eighth == 2}">
							号源:(${tSchedue.pmEighth})
						</c:if>
						<c:if test="${tSchedue.eighth == 3}">
							号源:(${tSchedue.amEighth + tSchedue.pmEighth})
						</c:if>
						<c:if test="${tSchedue.eighth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.ninth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.ninth == 1}">
							号源:(${tSchedue.amNinth})
						</c:if>
						<c:if test="${tSchedue.ninth == 2}">
							号源:(${tSchedue.pmNinth})
						</c:if>
						<c:if test="${tSchedue.ninth == 3}">
							号源:(${tSchedue.amNinth + tSchedue.pmNinth})
						</c:if>
						<c:if test="${tSchedue.ninth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.tenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.tenth == 1}">
							号源:(${tSchedue.amTenth})
						</c:if>
						<c:if test="${tSchedue.tenth == 2}">
							号源:(${tSchedue.pmTenth})
						</c:if>
						<c:if test="${tSchedue.tenth == 3}">
							号源:(${tSchedue.amTenth + tSchedue.pmTenth})
						</c:if>
						<c:if test="${tSchedue.tenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.eleventh, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.eleventh == 1}">
							号源:(${tSchedue.amEleventh})
						</c:if>
						<c:if test="${tSchedue.eleventh == 2}">
							号源:(${tSchedue.pmEleventh})
						</c:if>
						<c:if test="${tSchedue.eleventh == 3}">
							号源:(${tSchedue.amEleventh + tSchedue.pmEleventh})
						</c:if>
						<c:if test="${tSchedue.eleventh == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twelfth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twelfth == 1}">
							号源:(${tSchedue.amTwelfth})
						</c:if>
						<c:if test="${tSchedue.twelfth == 2}">
							号源:(${tSchedue.pmTwelfth})
						</c:if>
						<c:if test="${tSchedue.twelfth == 3}">
							号源:(${tSchedue.amTwelfth + tSchedue.pmTwelfth})
						</c:if>
						<c:if test="${tSchedue.twelfth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.thirteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.thirteenth == 1}">
							号源:(${tSchedue.amThirteenth})
						</c:if>
						<c:if test="${tSchedue.thirteenth == 2}">
							号源:(${tSchedue.pmThirteenth})
						</c:if>
						<c:if test="${tSchedue.thirteenth == 3}">
							号源:(${tSchedue.amThirteenth + tSchedue.pmThirteenth})
						</c:if>
						<c:if test="${tSchedue.thirteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.fourteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.fourteenth == 1}">
							号源:(${tSchedue.amFourteenth})
						</c:if>
						<c:if test="${tSchedue.fourteenth == 2}">
							号源:(${tSchedue.pmFourteenth})
						</c:if>
						<c:if test="${tSchedue.fourteenth == 3}">
							号源:(${tSchedue.amFourteenth + tSchedue.pmFourteenth})
						</c:if>
						<c:if test="${tSchedue.fourteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.fifteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.fifteenth == 1}">
							号源:(${tSchedue.amFifteenth})
						</c:if>
						<c:if test="${tSchedue.fifteenth == 2}">
							号源:(${tSchedue.pmFifteenth})
						</c:if>
						<c:if test="${tSchedue.fifteenth == 3}">
							号源:(${tSchedue.amFifteenth + tSchedue.pmFifteenth})
						</c:if>
						<c:if test="${tSchedue.fifteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.sixteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.sixteenth == 1}">
							号源:(${tSchedue.amSixteenth})
						</c:if>
						<c:if test="${tSchedue.sixteenth == 2}">
							号源:(${tSchedue.pmSixteenth})
						</c:if>
						<c:if test="${tSchedue.sixteenth == 3}">
							号源:(${tSchedue.amSixteenth + tSchedue.pmSixteenth})
						</c:if>
						<c:if test="${tSchedue.sixteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.seventeenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.seventeenth == 1}">
							号源:(${tSchedue.amSeventeenth})
						</c:if>
						<c:if test="${tSchedue.seventeenth == 2}">
							号源:(${tSchedue.pmSeventh})
						</c:if>
						<c:if test="${tSchedue.seventeenth == 3}">
							号源:(${tSchedue.amSeventeenth + tSchedue.pmSeventh})
						</c:if>
						<c:if test="${tSchedue.seventeenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.eighteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.eighteenth == 1}">
							号源:(${tSchedue.amEighteenth})
						</c:if>
						<c:if test="${tSchedue.eighteenth == 2}">
							号源:(${tSchedue.pmEighteenth})
						</c:if>
						<c:if test="${tSchedue.eighteenth == 3}">
							号源:(${tSchedue.amEighteenth + tSchedue.pmEighteenth})
						</c:if>
						<c:if test="${tSchedue.eighteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.nineteenth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.nineteenth == 1}">
							号源:(${tSchedue.amNineteenth})
						</c:if>
						<c:if test="${tSchedue.nineteenth == 2}">
							号源:(${tSchedue.pmNineteenth})
						</c:if>
						<c:if test="${tSchedue.nineteenth == 3}">
							号源:(${tSchedue.amNineteenth + tSchedue.pmNineteenth})
						</c:if>
						<c:if test="${tSchedue.nineteenth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentieth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentieth == 1}">
							号源:(${tSchedue.amTwentieth})
						</c:if>
						<c:if test="${tSchedue.twentieth == 2}">
							号源:(${tSchedue.pmTwentieth})
						</c:if>
						<c:if test="${tSchedue.twentieth == 3}">
							号源:(${tSchedue.amTwentieth + tSchedue.pmTwentieth})
						</c:if>
						<c:if test="${tSchedue.twentieth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentyFirst, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyFirst == 1}">
							号源:(${tSchedue.amTwentyFirst})
						</c:if>
						<c:if test="${tSchedue.twentyFirst == 2}">
							号源:(${tSchedue.pmTwentyFirst})
						</c:if>
						<c:if test="${tSchedue.twentyFirst == 3}">
							号源:(${tSchedue.amTwentyFirst + tSchedue.pmTwentyFirst})
						</c:if>
						<c:if test="${tSchedue.twentyFirst == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentySecond, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentySecond == 1}">
							号源:(${tSchedue.amTwentySecond})
						</c:if>
						<c:if test="${tSchedue.twentySecond == 2}">
							号源:(${tSchedue.pmTwentySecond})
						</c:if>
						<c:if test="${tSchedue.twentySecond == 3}">
							号源:(${tSchedue.amTwentySecond + tSchedue.pmTwentySecond})
						</c:if>
						<c:if test="${tSchedue.twentySecond == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentyThird, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyThird == 1}">
							号源:(${tSchedue.amTwentyThird})
						</c:if>
						<c:if test="${tSchedue.twentyThird == 2}">
							号源:(${tSchedue.pmTwentyThird})
						</c:if>
						<c:if test="${tSchedue.twentyThird == 3}">
							号源:(${tSchedue.amTwentyThird + tSchedue.pmTwentyThird})
						</c:if>
						<c:if test="${tSchedue.twentyThird == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentyFourth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyFourth == 1}">
							号源:(${tSchedue.amTwentyFourth})
						</c:if>
						<c:if test="${tSchedue.twentyFourth == 2}">
							号源:(${tSchedue.pmTwentyFourth})
						</c:if>
						<c:if test="${tSchedue.twentyFourth == 3}">
							号源:(${tSchedue.amTwentyFourth + tSchedue.pmTwentyFourth})
						</c:if>
						<c:if test="${tSchedue.twentyFourth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentyFifth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyFifth == 1}">
							号源:(${tSchedue.amTwentyFifth})
						</c:if>
						<c:if test="${tSchedue.twentyFifth == 2}">
							号源:(${tSchedue.pmTwentyFifth})
						</c:if>
						<c:if test="${tSchedue.twentyFifth == 3}">
							号源:(${tSchedue.amTwentyFifth + tSchedue.pmTwentyFifth})
						</c:if>
						<c:if test="${tSchedue.twentyFifth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentySixth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentySixth == 1}">
							号源:(${tSchedue.amTwentySixth})
						</c:if>
						<c:if test="${tSchedue.twentySixth == 2}">
							号源:(${tSchedue.pmTwentySixth})
						</c:if>
						<c:if test="${tSchedue.twentySixth == 3}">
							号源:(${tSchedue.amTwentySixth + tSchedue.pmTwentySixth})
						</c:if>
						<c:if test="${tSchedue.twentySixth == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentySeventh, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentySeventh == 1}">
							号源:(${tSchedue.amTwentySeventh})
						</c:if>
						<c:if test="${tSchedue.twentySeventh == 2}">
							号源:(${tSchedue.pmTwentySeventh})
						</c:if>
						<c:if test="${tSchedue.twentySeventh == 3}">
							号源:(${tSchedue.amTwentySeventh + tSchedue.pmTwentySeventh})
						</c:if>
						<c:if test="${tSchedue.twentySeventh == 4}">
						</c:if>
				</td>
				<td>
					${fns:getDictLabel(tSchedue.twentyEighth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyEighth == 1}">
							号源:(${tSchedue.amTwentyEighth})
						</c:if>
						<c:if test="${tSchedue.twentyEighth == 2}">
							号源:(${tSchedue.pmTwentyEighth})
						</c:if>
						<c:if test="${tSchedue.twentyEighth == 3}">
							号源:(${tSchedue.amTwentyEighth + tSchedue.pmTwentyEighth})
						</c:if>
						<c:if test="${tSchedue.twentyEighth == 4}">
						</c:if>
				</td>
				<c:if test="${not empty tSchedue.twentyNinth}">
				<td>
					${fns:getDictLabel(tSchedue.twentyNinth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.twentyNinth == 1}">
							号源:(${tSchedue.amTwentyNinth})
						</c:if>
						<c:if test="${tSchedue.twentyNinth == 2}">
							号源:(${tSchedue.pmTwentyNinth})
						</c:if>
						<c:if test="${tSchedue.twentyNinth == 3}">
							号源:(${tSchedue.amTwentyNinth + tSchedue.pmTwentyNinth})
						</c:if>
						<c:if test="${tSchedue.twentyNinth == 4}">
						</c:if>
				</td>
				</c:if>
				<c:if test="${not empty tSchedue.thirtieth}">
				<td>
					${fns:getDictLabel(tSchedue.thirtieth, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.thirtieth == 1}">
							号源:(${tSchedue.amThirtieth})
						</c:if>
						<c:if test="${tSchedue.thirtieth == 2}">
							号源:(${tSchedue.pmThirtieth})
						</c:if>
						<c:if test="${tSchedue.thirtieth == 3}">
							号源:(${tSchedue.amThirtieth + tSchedue.pmThirtieth})
						</c:if>
						<c:if test="${tSchedue.thirtieth == 4}">
						</c:if>
				</td>
				</c:if>
				<c:if test="${not empty tSchedue.thirtyFirst}">
				<td>
					${fns:getDictLabel(tSchedue.thirtyFirst, 'schedue_template', '')}
						<br/>
						<c:if test="${tSchedue.thirtyFirst == 1}">
							号源:(${tSchedue.amThirtyFirst})
						</c:if>
						<c:if test="${tSchedue.thirtyFirst == 2}">
							号源:(${tSchedue.pmThirtyFirst})
						</c:if>
						<c:if test="${tSchedue.thirtyFirst == 3}">
							号源:(${tSchedue.amThirtyFirst + tSchedue.pmThirtyFirst})
						</c:if>
						<c:if test="${tSchedue.thirtyFirst == 4}">
						</c:if>
				</td>
				</c:if>
				<td>
					<fmt:formatDate value="${tSchedue.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${tSchedue.remarks}
				</td>
				<shiro:hasPermission name="phy:tSchedue:edit"><td>
    				<a href="${ctx}/phy/tSchedue/form?id=${tSchedue.id}">修改</a>
<%--					<a href="${ctx}/phy/tSchedue/delete?id=${tSchedue.id}" onclick="return confirmx('确认要删除该排班吗？', this.href)">删除</a>--%>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
